<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>CruiseControl.NET : Upgrading CCNet</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            CruiseControl.NET : Upgrading CCNet
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Nov 15, 2007 by <font color="#0050B2">williams</font>.
				    </div>

				    <p>This document describes two approaches to upgrading CCNet: a quick upgrade process (<b>optimistic</b>) and a slower, safer upgrade process that allows for quickly rolling back to the earlier install if required (<b>pessimistic</b>).</p>

<h2><a name="UpgradingCCNet-OptimisticApproach%3A"></a>Optimistic Approach:</h2>

<ol>
	<li>Stop the CCNet server (either by closing the console window or stopping CCService)</li>
	<li>Create a backup of the CCNet installation directory (the project artifact directories can be excluded as they could be large considering the size and number of build logs)</li>
	<li>Install the new version of CCNet over top of the existing installation (to the same installation directory).  The installer will not be able to register the service or create the virtual directory; however, as the same directory will be used this does not matter.</li>
	<li>Replace the new ccnet.config file with the backed up copy (ccnet.config.old).  Restore any changes to the &#42;.exe.config file, dashboard.config file, or xsl files from the backed up copy.</li>
	<li>Try starting the ccnet console and resolve any required changes to the ccnet.config file.  See the release notes for a list of configuration file changes in the latest version.  If you use CCService, stop the console application and start CCService at this point.</li>
	<li>Verify that the webdashboard is accessible and that all projects are started, have the correct version and their build log render correctly.</li>
	<li>Download the CCTray installer from the Dashboard, install it locally and verify that it connects to the server/dashboard and that the projects display correctly.</li>
	<li>Everything should be working now and the installation should be complete.  If there were any problems encountered during the install, stop CCNet and then restore the previous version from the backup folder.</li>
</ol>


<h2><a name="UpgradingCCNet-PessimisticApproach%3A"></a>Pessimistic Approach:</h2>

<ol>
	<li>Install the new version of CCNet to a different installation directory.  The installer will not be able to register the new service or create the new virtual directory - these will be handled later.</li>
	<li>Copy the ccnet.config and all .state files from the previous installation folder into the new installation directory.  Merge any changes from the application configuration files (ccnet.exe.config, ccservice.exe.config, dashboard.config) into the new configuration files.  Merge any changed stylesheets into the new stylesheet folders (in both the server and dashboard xsl folders).  Also copy the project artifact directories from the previous installation folder.</li>
	<li>Stop the previous version of the CCNet server (either by closing the console window or stopping CCService)</li>
	<li>Start the new version of the CCNet console and resolve any problems with the ccnet.config file. See the release notes for a list of configuration file changes in the latest version.</li>
	<li>Create a new virtual directory for the /dashboard folder (eg. include the installation version in the virtual directory name).<br/>
Ensure that the directory has script, but not execute permission (to support downloading the CCTray installation).  The &lt;webURL&gt; property in the ccnet.config file will need to change to reflect this new virtual directory name.</li>
	<li>Verify that the webdashboard is accessible and that all projects are started, have the correct version and their build log render correctly.</li>
	<li>Download the CCTray installer from the Dashboard, install it locally and verify that it connects to the server/dashboard and that the projects display correctly.</li>
	<li>If you are using CCService, register the new service using the command:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">%SystemRoot%\Microsoft.NET\Framework\v1.1.4322\installutil.exe /ServiceName=<span class="code-quote">"CCService &lt;version&gt;"</span> ccservice.exe</pre>
</div></div>
<p>From version 1.3 onwards, CCNet is based on Dot Net Framework 2.0, so change the above to :<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\installutil.exe /ServiceName=<span class="code-quote">"CCService &lt;version&gt;"</span> ccservice.exe</pre>
</div></div><br/>
Replace '&lt;version&gt;' with the version of CCNet that you are installing.  Start the service.</p></li>
	<li>Everything should be working now and the installation should be complete.  If there were any problems encountered during the install, stop the new CCNet server and start the old CCNet server.</li>
</ol>


				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Sep 29, 2009 20:59</font></td>
		    </tr>
	    </table>
    </body>
</html>